package com.example.runningdemo.designModel.facade;

/**
 * @program: Running-Demo
 * @description: 外观业务
 * @author: kangwei
 * @create: 2024-08-12 09:30
 **/
public class FacadeBusinessService {

    AliSmsService aliSmsService;
    EmailService emailService;
    WeChatOfficialAccountPushService weChatOfficialAccountPushService;

    public FacadeBusinessService() {
        aliSmsService = new AliSmsServiceImpl();
        emailService = new EmailServiceImpl();
        weChatOfficialAccountPushService = new WeChatOfficialAccountPushServiceImpl();
    }


    /**
     * 封装短信方法,只需调用此方法即可实现发送短信，调用者不关心具体实现
     */
    public void sendSms() {
        aliSmsService.sendSms();
        emailService.sendSms();
        weChatOfficialAccountPushService.sendSms();
    }

    public static void main(String[] args) {
        FacadeBusinessService businessService = new FacadeBusinessService();
        businessService.sendSms();
    }

}
